//package com.heima.user.listener;
//
//import com.alibaba.fastjson.JSON;
//import com.heima.media.entity.WmChannel;
//import com.heima.user.entity.ApUserChannel;
//import com.heima.user.service.IApUserChannelService;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.kafka.clients.consumer.ConsumerRecord;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.kafka.annotation.KafkaListener;
//import org.springframework.kafka.core.KafkaTemplate;
//import org.springframework.stereotype.Component;
//@Slf4j
//@Component
//public class UpdateChannelListener {
//
//
//    @Autowired
//    private IApUserChannelService apUserChannelService;
//
//    @KafkaListener(topics = "update_channel")
//    public void updateChannel(ConsumerRecord<String,String> consumerRecord){
//        String value = consumerRecord.value();
//        WmChannel wmChannel = JSON.parseObject(value, WmChannel.class);
//        System.out.println("user端监听到了updateChannel"+wmChannel);
//        apUserChannelService.updateChannel(wmChannel);
//    }
//
//
//}
